<?php


class SmartyView extends View {

    public static $smarty;

    static function display($template) {
        self::setup();

        self::$smarty->display($template);        
    }

    public static function setup() {
        // strftime() doesn't like not having a timezone
        date_default_timezone_set('Pacific/Auckland');
        require_once('smarty/Smarty.class.php');
        self::$smarty = new Smarty();
        self::$smarty->template_dir = CodyMVC::get_config('smarty_template_dir');
        self::$smarty->compile_dir  = CodyMVC::get_config('smarty_compile_dir');
        self::$smarty->config_dir   = CodyMVC::get_config('smarty_config_dir');
        self::$smarty->cache_dir    = CodyMVC::get_config('smarty_cache_dir');
        self::$smarty->plugins_dir[] = CodyMVC::get_config('smarty_plugins_dir');

        self::$smarty->caching = CodyMVC::get_config('smarty_caching');    
    }

}

?>
